﻿<#include "include/_meta.html">
<title>订单列表</title>
</head>
<body>
<nav class="breadcrumb"><i class="Hui-iconfont">&#xe67f;</i> 首页 <span class="c-gray en">&gt;</span> 还车管理 <span class="c-gray en">&gt;</span> 我要还车 <a class="btn btn-success radius r" style="line-height:1.6em;margin-top:3px" href="javascript:location.replace(location.href);" title="刷新" ><i class="Hui-iconfont">&#xe68f;</i></a></nav>
<div class="page-container" style="margin: 0 auto;"  >
	<div class="text-c"> 
		<form action="" method="get" id="form">
		订单号：<input type="text" class="input-text" style="width:250px" placeholder="输入订单号" id="orderid" name="orderid" value="${(info.orderid)!""}">
		<button type="submit" class="btn btn-success" id="searchUsers" name=""><i class="Hui-iconfont">&#xe665;</i> 搜订单</button>  &nbsp;&nbsp;${(worn)!''}
		</form>
	</div>
	<form class="form form-horizontal" id="form-admin-add" >
	<div style="width: 1150x;margin:0 auto;margin-left:200px;" id="userListTable" class="cl pd-5 bg-1 bk-gray mt-20" >
		<div style="width: 1150px;">
				<table  height="500" class="cl pd-5 bg-1 bk-gray mt-20">
					<tr height="50px" width="300" >
						<td rowspan="4" width="300"><div style="width:200;height:200;"><img src="${(picurl)!'images'}/${(picname)!'1.jpg'}" alt="汽车图片" style="width:200px;height:200px;"/></div></td>
						<td width="250" >车辆类型：${(car.carbrand)!''}</td>
						<td width="250"><#if car?exists>手动/自动:<#if car.isauto==1>手动</#if><#if car.isauto==0>自动</#if><#else>手动/自动:</#if>/排量:${(car.enginesize)!''}T/座位数:${(car.seatnum)!''}</td>
						<th width="350"><b>费用明细：</b></th>
					</tr>
					<tr width="200" height="50px">
						<th><b>取车地</b></th>
						<th><b>还车地</b></th>
						<td id="realrent" >租赁费用：￥${(info.realrent)!''}</td>
					</tr>
					<tr width="200" height="50px" >
						<td>取车门店：${(info.btrentdept)!''}</td>
						<td>还车门店：${(info.etrentdept)!''}</td>
						<td>基本保险：￥${(info.realbasic)!''}</td>
					</tr>
					<tr height="50px" width="200">
						<td>取车时间：${(info.readybttime)!''}</td>
						<td>还车时间：${(info.readettime)!''}</td>
						<td>总计：￥${(sumMoney)!''}</td>
					</tr>
					<tr height="50px" width="200">
						<td text-align="center">车辆图片</td>
						<td>详细地址：${(info.btrentdept)!''}</td>
						<td>详细地址：${(info.btrentdept)!''}</td>
						<td>实际预售押金：￥${(carPrice.tempmoney)!''}</td>
					</tr>
					<tr height="50px"  width="200">
						<td colspan="3">租期：${(day)!''}天</td>
						<td>实际违章押金：￥${(carPrice.rulemoney)!''}</td>
					</tr>
					<tr height="50px" width="200">
						<td>实际取车时间：<input type="text" value="${(info.realbttime)!''}" id="realbttime" readonly></td>
						<td colspan="2">实际还车时间：<input type="text" onmouseover="this.style.borderColor='black';this.style.backgroundColor='plum'" style="width: 106; height: 30" onmouseout="this.style.borderColor='black';this.style.backgroundColor='#ffffff'" style="border-width:1px;border-color=black" onfocus="WdatePicker({minDate:'#F{$dp.$D(\'realbttime\')}',maxDate:'%y-%M-%d'})" id="realettime" value="${(info.realettime)!''}" input-text Wdate" style="width:120px;" ></td>
						<td>实际支付：￥${(readyMoney)!''}</td>
					</tr>
					<tr height="50px" width="200">
						<td>实际还车油量：<input type="text" onmouseover="this.style.borderColor='black';this.style.backgroundColor='plum'" style="width: 106; height: 21" onmouseout="this.style.borderColor='black';this.style.backgroundColor='#ffffff'" style="border-width:1px;border-color=black" value="${(info.realetoil)!''}" id="realetoil"/> </td>
						<td colspan="3">实际还车里程：<input type="text" onmouseover="this.style.borderColor='black';this.style.backgroundColor='plum'" style="width: 106; height: 30" onmouseout="this.style.borderColor='black';this.style.backgroundColor='#ffffff'" style="border-width:1px;border-color=black" id="realetmile" value="${(info.realetmile)!''}" /></td>
					</tr>
					<tr height="50px" width="200">
						<td>扣除超时费用：￥<input id="returntimeout" onmouseover="this.style.borderColor='black';this.style.backgroundColor='plum'" style="width: 106; height: 30" onmouseout="this.style.borderColor='black';this.style.backgroundColor='#ffffff'" style="border-width:1px;border-color=black" value="${(info.returntimeout)!''}" /></td>
						<td colspan="2">扣除车损费用：￥<input id="returndamage" onmouseover="this.style.borderColor='black';this.style.backgroundColor='plum'" style="width: 106; height: 30" onmouseout="this.style.borderColor='black';this.style.backgroundColor='#ffffff'" style="border-width:1px;border-color=black" value="${(info.returndamage)!''}" /></td>
					</tr>
					<tr>
						<td></td>
						<td></td>
						<input type="hidden" id="carstate" value="${(car.carstate)!''}"/>
						<input type="hidden" id="orderstate" value="${(info.orderstate)!''}"/>
						<input type="hidden" id="orderid" value="${(info.orderid)!''}"/>
						<input type="hidden" id="carid" value="${(car.carid)!''}"/>
						<td align="left"><input class="btn btn-primary radius" type="button" value="&nbsp;&nbsp;还车登记&nbsp;&nbsp;" id="aa"/></td>
						<td></td>
					</tr>
				</table>
			</div>
			</form>
	</div>
</div>
<#include "include/_footer.html">



<script type="text/javascript" language="javascript">

 $(function(){
 
 	$("#searchUsers").click(function(){
 			if($("#orderid").val()==null || $("#orderid").val()=="" ){
 				alert("请输入订单编号！");
 				return false;
 			}
 				
 			$.ajax({
                    type: "get",
                    contentType:"application/json",                 
                    url: "/orderlist/${(info.orderid)!''}",
					
          });
	});
 
 


	$("#aa").click(function(){
		
		if($("#realettime").val()==null || $("#realettime").val()==""){
			alert("请输入还车日期");
			return false;
			}
			if($("#realetoil").val()==null || $("#realetoil").val()==""){
			alert("还车油量：请输入还车油量");
			return false;
			}
		var reg=new RegExp("^[0-9]*(\.[0-9]*|[eE][+-][0-9]*)$");
		var realetoil=$("#realetoil").val();
		if(!reg.test(realetoil)){
			alert("还车油量：请输入数字");
			return false;	
			}
		if($("#realetmile").val()==null || $("#realetmile").val()==""){
			alert("还车里程：请输入还车油量");
			return false;	
			}
		var realetmile=$("#realetmile").val();
		if(!reg.test(realetmile)){
			alert("还车里程：请输入数字");
			return false;	
			}
		var returntimeout=$("#returntimeout").val();
		if(!reg.test(returntimeout)){
			alert("超时费用：请输入数字");
			return false;	
			}
			var returndamage=$("#returndamage").val();
		if(!reg.test(returndamage)){
			alert("车损费用：请输入数字");
			return false;	
			}
		
		$.ajax({
                    type: "put",
                    contentType:"application/json",                 
                    url: "/orders/${(info.orderid)!''}",
	            	data:JSON.stringify({
                             'realettime':$("#realettime").val(),
                             'returntimeout':$("#returntimeout").val(),
                             'returndamage':$("#returndamage").val(),
                             'carid':$("#carid").val(),
							 'orderstate':"4",
							 'carstate':"6"
                            }),
					success: function() { 
						alert("还车成功！请在一周后来退还押金！");
						var index = parent.layer.getFrameIndex(window.name);
						parent.$("#searchOrders").click();
						parent.layer.close(index);
					}
	});});
});</script>
</body>
</html>
